<template>
  <div class="rights">
    <!-- 面包屑 -->
    <miAn-xie :betGao="betGao"></miAn-xie>
    <el-card>
          <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column
        type="index"
        label="#">
      </el-table-column>
      <el-table-column
        prop="authName"
        label="权限名称"
        >
      </el-table-column>
      <el-table-column
        prop="path"
        label="权限路径">
      </el-table-column>
      <el-table-column
        label="权限等级">
        <template slot-scope="scope">
          <el-button :type="color[scope.row.level]">{{levels[scope.row.level]}}级</el-button>
        </template>
      </el-table-column>
    </el-table>
    </el-card>
  </div>
</template>
<script>
import { roles_rights } from "@/http/rights/right";
export default {
  data() {
    return {
      // 面包屑
      betGao:[
        {
          'path':'/home',
          'title':'首页'
        },
        {
          'path':'/rights',
          'title':'权限管理'
        },
        {
          'path':'/rights',
          'title':'权限列表'
        },
      ],
        tableData:[],
        color:['success','primary','danger'],
        levels:['一','二','三']
    };
  },
  mounted(){
    this.roles_right()
  },
  methods:{
    async roles_right(){
      let res=await roles_rights('list')
      console.log(res);
      this.tableData=res.data
    }
  }
};
</script>
<style lang="scss" scoped>

</style>